import httpInstance from '@/utils/http.js'

// 获取banner图片数据
export const homeGetBannerAPI = (params = {}) => {
  // 默认为1 1为首页 2为分类商品页
  const { distributionSite = '1' } = params
  return httpInstance({
    url: '/home/banner',
    params: {
      distributionSite
    }
  })
}

/**
 * @description: 获取新鲜好物
 * @param {*}
 * @return {*}
 */
export const homeGetNewAPI = () => {
  return httpInstance.get('/home/new')
}

/**
 * @description: 获取人气推荐
 * @param {*}
 * @return {*}
 */
export const homeGetHotAPI = () => {
  return httpInstance.get('/home/hot')
}

/**
 * @description: 获取所有商品模块
 * @param {*}
 * @return {*}
 */
export const homeGetGoodsAPI = () => {
  return httpInstance({
    url: '/home/goods'
  })
}
